package les.portal.testes;

import junit.framework.TestCase;
import les.portal.util.LogadoInfo;
import les.portal.util.Permissao;

/**
 * Teste para a classe LogadoInfo.
 * @author Anne Caroline
 * @author Bruno Coitinho
 * @author Gustavo de Farias
 * @author Maria de Lourdes
 *
 * 
 */
public class LogadoInfoTest extends TestCase {

	/*
	 * Test method for 'les.portal.util.LogadoInfo.getPermissaoString()'
	 */
	public void testGetPermissaoString() {
		LogadoInfo info1 = new LogadoInfo(1, "umLogin1", Permissao.Administrador);
		LogadoInfo info2 = new LogadoInfo(2, "umLogin2", Permissao.Supervisor);
		LogadoInfo info3 = new LogadoInfo(3, "umLogin3", Permissao.Cliente);
		
		assertEquals("Administrador", info1.getPermissaoString());
		assertEquals("Supervisor", info2.getPermissaoString());
		assertEquals("Cliente", info3.getPermissaoString());
	}

	/*
	 * Test method for 'les.portal.util.LogadoInfo.getPermissao()'
	 */
	public void testGetPermissao() {
		LogadoInfo info1 = new LogadoInfo(1, "umLogin1", Permissao.Administrador);
		LogadoInfo info2 = new LogadoInfo(2, "umLogin2", Permissao.Supervisor);
		LogadoInfo info3 = new LogadoInfo(3, "umLogin3", Permissao.Cliente);
		
		assertEquals(Permissao.Administrador, info1.getPermissao());
		assertEquals(Permissao.Supervisor, info2.getPermissao());
		assertEquals(Permissao.Cliente, info3.getPermissao());
	}

	/*
	 * Test method for 'les.portal.util.LogadoInfo.getUserHome()'
	 */
	public void testGetUserHome() {
		LogadoInfo info1 = new LogadoInfo(1, "umLogin1", Permissao.Administrador);
		LogadoInfo info2 = new LogadoInfo(2, "umLogin2", Permissao.Supervisor);
		LogadoInfo info3 = new LogadoInfo(3, "umLogin3", Permissao.Cliente);
		
		assertEquals("homeAdministrador", info1.getUserHome());
		assertEquals("homeSupervisor", info2.getUserHome());
		assertEquals("homeCliente", info3.getUserHome());
	}
}